package com.hspedu.hspliving.commodity.web;

import com.hspedu.common.utils.PageUtils;
import com.hspedu.hspliving.commodity.entity.SkuInfoEntity;
import com.hspedu.hspliving.commodity.service.SkuInfoService;
import com.hspedu.hspliving.commodity.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author: xujiabing
 * @date: 2024/8/19 19:54
 * @description web页面检索控制器
 */
@Controller
public class SearchController {

    @Autowired
    private SkuInfoService skuInfoService;

    /**
     * 购买用户-检索页面
     * @return
     */
    @RequestMapping("/list.html")
    public String searchList(@RequestParam Map<String, Object> params, Model model){
        SearchResult searchResult = skuInfoService.querySearchPageByCondition(params);
        //返回到模板引擎界面
        model.addAttribute("result",searchResult);

        return "list";
    }
}
